import request from "@/utils/request";

// 查询收货通知单列表
export function listGoods(query) {
  return request({
    url: "/mes/wm/receive/list",
    method: "get",
    params: query,
  });
}

// 查询收货通知单详细
export function getGoods(receiptId) {
  return request({
    url: "/mes/wm/receive/selectList/" + receiptId,
    method: "get",
  });
}
export function receiveWarehousing(receiptId) {
  return request({
    url: "/mes/wm/receive/warehousing/" + receiptId,
    method: "get",
  });
}

// 新增收货通知单
export function addGoods(data) {
  return request({
    url: "/mes/wm/goods",
    method: "post",
    data: data,
  });
}

// 修改收货通知单
export function updateGoods(data) {
  return request({
    url: "/mes/wm/goods",
    method: "put",
    data: data,
  });
}

// 删除收货通知单
export function delGoods(receiptId) {
  return request({
    url: "/mes/wm/receive/" + receiptId,
    method: "delete",
  });
}

// 审核接口
export function approveWmReceive(data) {
  return request({
    url: "/mes/wm/receive/approveWmReceive",
    method: "put",
    data: data,
  });
}

export function saveToErp(data) {
  return request({
    url: "/mes/qc/iqcHead/saveToErp",
    method: "post",
    data: data,
  });
}

// //同步来料通知单
// export function synchronization(query) {
//   return request({
//     url: "/mes/k3cloud/api/receive/syncReceiveList",
//     method: "get",
//     params: query,
//   });
// }

//同步来料通知单
export function synchronization(query) {
  return request({
    url: "/sync/k3cloud/api/wmReceiveSync/receiveSync",
    method: "get",
    params: query,
  });
}
